package remote.controllers;

import remote.constants.IRequestTypes;
import remote.constants.IReturnCodes;
import remote.constants.IWMPConstants;
import remote.activities.R;
import android.app.Activity;
import android.view.View;
import android.widget.Toast;

public class SystemController extends BaseController
{
	public SystemController(Activity activity)
	{
		super(activity);
	}
	
	@Override
	public void onClick(View v)
	{
		switch (v.getId())
		{
			case R.id.system_imgShutdown :
				String response = _client.send(IRequestTypes.SYSTEM_REMOTE, IWMPConstants.SHUTDOWN);
				
				if(response.equals(IReturnCodes.SUCCESS))
					Toast.makeText(_activity, "Shutdown in progress...", Toast.LENGTH_SHORT).show();
				else
					Toast.makeText(_activity, "Error", Toast.LENGTH_SHORT).show();
				break;
		}
	}
}
